<?php

declare(strict_types=1);

namespace App\Game\Model;

use App\Fastapp\Model\FastappTag;
use Hyperf\Database\Model\Relations\HasOne;
use Mine\MineModel;

/**
 * @property int $id 主键
 * @property int $tag_id 标签id
 * @property int $game_id 游戏id
 */
class GameTag extends MineModel
{
    public bool $timestamps = false;
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'game_tag';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'tag_id', 'game_id'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'tag_id' => 'integer', 'game_id' => 'integer'];

    public function tag(): HasOne
    {
        return $this->hasOne(FastappTag::class, 'id', 'tag_id');
    }
}
